package com.itheima.InnerClass5;

public class Student
{
    private String name;
    private int age;
    private double height;
    private String sex;
    public Student(String name, int age, double height, String sex)
    {
        this.name=name;
        this.age=age;
        this.height=height;
        this.sex=sex;
    }
    public Student() {}
    public int compare(Student o1, Student o2) {
      if(o1.getAge()>o2.getAge())
      {
          return 1;
      }
      else if(o1.getAge()<o2.getAge())
      {
          return -1;
      }
      else {
          return 0;
      }
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getHeight() {
        return height;
    }

    public void setHeight(double height) {
        this.height = height;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", height=" + height +
                ", sex='" + sex + '\'' +
                '}';
    }
}
